<?php
/**
 * Created by PhpStorm.
 * User: zzw
 * Date: 17-2-27
 * Time: 下午5:42
 */
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

class Company_model extends MY_Model
{
    protected $table = 'company';
    // 设定
    public function set($id,$arr)
    {
        $this->db->set($arr)
            -> where(array('id'=>$id))
            -> update($this->table);
        return $this->db->affected_rows();
    }
    public function add_scan($id)
    {
        $this->db->set('scan','scan+1',FALSE);
        $this->db->where('id',$id);
        $this->db->update($this->table);
        $res = $this->db->affected_rows();

        return $res;
    }
    /**
     * 用户未进行审核的数量
     */
    public function get_status_nums(){
        $query = $this->db
            ->select('count(*) as total')
            ->from($this->table)
            ->where(array('is_combing'=>1,'status'=>0))
            ->get();
        return $query->row_array();
    }
}